package minov.test;

import java.util.Arrays;

import minov.parser.ArgumentParser;
import minov.parser.BooleanArgument;
import minov.parser.CommandArgument;
import minov.parser.EnumArgument;
import minov.parser.FileArgument;
import minov.parser.IntegerArgument;
import minov.parser.SwitchArgument;
import minov.parser.TextArgument;

public class ArgumentPrinterUtil {

   public static void
         print(SwitchArgument swithArgument, ArgumentParser parser) {

      if (swithArgument.isEntered()) {
         // check file
         System.out.println(String.format("Argument %s is set",
               parser.getArgumentId(swithArgument)));
      } else {
         System.out.println(String.format("Argument %s is not set",
               parser.getArgumentId(swithArgument)));
      }
   }

   public static void
         print(BooleanArgument boolArgument, ArgumentParser parser) {

      if (boolArgument.isEntered()) {
         // check file
         System.out.println(String.format("Argument %s is set to %s",
               parser.getArgumentId(boolArgument),
               Arrays.toString(boolArgument.getAllValues())));
      } else {
         System.out.println(String.format("Argument %s is not set",
               parser.getArgumentId(boolArgument)));
      }
   }
   
   public static void
   print(IntegerArgument argument, ArgumentParser parser) {
      
      if (argument.isEntered()) {
         // check file
         System.out.println(String.format("Argument %s is set to %s",
               parser.getArgumentId(argument),
               Arrays.toString(argument.getAllValues())));
      } else {
         System.out.println(String.format("Argument %s is not set",
               parser.getArgumentId(argument)));
      }
   }
   
   public static void
   print(FileArgument argument, ArgumentParser parser) {
      
      if (argument.isEntered()) {
         // check file
         System.out.println(String.format("Argument %s is set to %s",
               parser.getArgumentId(argument),
               Arrays.toString(argument.getAllValues())));
      } else {
         System.out.println(String.format("Argument %s is not set",
               parser.getArgumentId(argument)));
      }
   }

   public static void
   print(TextArgument argument, ArgumentParser parser) {
      
      if (argument.isEntered()) {
         // check file
         System.out.println(String.format("Argument %s is set to %s",
               parser.getArgumentId(argument),
               Arrays.toString(argument.getAllValues())));
      } else {
         System.out.println(String.format("Argument %s is not set",
               parser.getArgumentId(argument)));
      }
   }
   
   public static void
   print(EnumArgument argument, ArgumentParser parser) {
      
      if (argument.isEntered()) {
         // check file
         System.out.println(String.format("Argument %s is set to %s",
               parser.getArgumentId(argument),
               Arrays.toString(argument.getAllValues())));
      } else {
         System.out.println(String.format("Argument %s is not set",
               parser.getArgumentId(argument)));
      }
   }
   
   public static void print(CommandArgument command,ArgumentParser argParser)
   {
      if (command.isEntered())
      {
         System.out.println("Argument "+argParser.getArgumentId(command)+ " arguments called by command "+command.getValue());
         System.out.println("  "+Arrays.toString(command.getArguments()));
         
      }else
      {
         System.out.println("Command "+argParser.getArgumentId(command)+ " is not defined");
      }
   }
   
}
